<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="/include/nocache.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>cbing的空间</title>
  <meta name="baidu-tc-cerfication" content="b21281f9b17101b97c89995203826e13" />
	<!--[if IE]>
		<script type="text/javascript">
			(function(){
				var b=("abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video").split(","),a=b.length;while(a--){document.createElement(b[a])}})();
		</script>
	<![endif]-->
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/front/css/blogcss.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/script/jquery-1.9.1.min.js"></script>
 </head>
 <body background="${pageContext.request.contextPath}/front/imgs/bodybg.png" style="background-color:#f8f8f8" onload="fixPage();">
 	<jsp:include page="/front/common/header.jsp"></jsp:include>
	<section class="mod-page-body">
		<div class="mod-page-main wordwrap clearfix">
			<div class="x-page-container">
				<jsp:include page="/front/common/title.jsp"/>
				<div class="grid-98" style="margin-top:30px">
					<!-- 文章区 -->
					<jsp:include page="/front/artList.jsp"></jsp:include>
					<jsp:include page="/front/common/userinfo.jsp"></jsp:include>
				</div>
				<div class="grid-98">
					<div id="pageBar" class="mod-content2 grid-77 clearfix" style="margin-bottom:20px;margin-left:10px;_margin-left:5px;height:33px">
						<div style="padding-top:10px;text-align:center" id="pagediv">
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>
	<script>
		/**分页标签*/
		function fixPage(){
			var initCount=5;
			var page=${page};
			page=page==0?1:page;
			var pageSize=${pageSize};
			var total=${total};
			var pageCount=Math.ceil(total/pageSize);
			var start=1;
			var end=pageCount;
			if(page<initCount){
				start=1;
			}else{
				start=initCount-4;
			}
			if((page+initCount)>pageCount){
				end=pageCount;
			}else{
				end=page+5;
			}
			var html="";
			if(page!=1){
				html=html+"<a href='?page="+(page-1)+"' class='pagea'>&lt;&lt;上一页</a>";
			}
			for(var i=start;i<=end;i++){
				if(i==page){
					html=html+"<a class='pageaselect'>"+i+"</a>";
				}else{
					html=html+"<a href='?page="+i+"' class='pagea'>"+i+"</a>";
				}
			}
			if(page!=pageCount){
				html=html+"<a href='?page="+(page+1)+"' class='pagea'>下一页&gt;&gt;</a>";
			}
			$("#pagediv").html(html);
		}
	</script>
 </body>
</html>
